//
//  BorrowDetailRequest.m
//  BrushFace
//
//  Created by 吕海瑞 on 15/12/27.
//  Copyright © 2015年 Zzz. All rights reserved.
//

#import "BorrowDetailRequest.h"
#import "IWillHelper.h"
@implementation BorrowDetailRequest
-(void)loadRequest
{
    [super loadRequest];
    self.PATH = @"hope/gethopeinfo.json";
}

- (void)getBorrowDetailWithHopeId:(NSString *)hopeID andCB:(void (^)(id output))CB
{
    NSDictionary *params = @{
                             @"hopeid" : hopeID,
                             
                             };
    NSString *requestStr = [NSString stringWithFormat:@"%@/hope/listleidaborrow.json",SERVICE_ADRESS];
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    manager.responseSerializer = [[AFHTTPResponseSerializer alloc] init];
    [manager GET:requestStr parameters:params success:^(AFHTTPRequestOperation * _Nonnull operation, id  _Nonnull responseObject) {
        NSDictionary *jsonObject = [NSJSONSerialization JSONObjectWithData:responseObject options:0 error:nil];
        if (CB) {
            CB(jsonObject);
        }
        
    } failure:^(AFHTTPRequestOperation * _Nullable operation, NSError * _Nonnull error) {
        ITLogSP(@"error:%@",error.description);
    }];
    

}

@end
